#ifndef DEFINES_H
#define DEFINES_H

#define LED_PIN				13
#define VEH_SPEED_PIN		9
#define ENG_SPEED_PIN		10
#define FUEL_LVL_PIN		11

#define ACCEL_PIN				A0
#define BREAK_PIN				A1

#define INTERRUPT_CMP_CNT		124


//#define SECOND							1000
//
//#define STATISTIC_UPDATE_TIME			20 * SECOND
//#define CORRECT_FRM_CNT_MEM_ADDR		4	// 16 bit value
//#define INVALID_FRM_CNT_MEM_ADDR		6	// 16 bit value
//#define STATISTICS_STATE_MEM_ADDR		8	// 8 bit value
//
//#define TRANSMISSION_DELAY				2000


#ifndef NULL
#define NULL 0
#endif

// #define BREAK_FILTER_COEFF	0
// #define ACCEL_FILTER_COEFF	1


/*****************************************************************************/
/*************************	Signal filter coefficients   *********************/
/*****************************************************************************/
static const UInt8 SensorFilterCoeffs[] = { 2u, 2u, 2u, 2u, 2u};

//static const float BreakSensorFilterCoeffs[] =	{
//													0.039998528190083385f,
//													0.18098440003137717f,
//													0.34475531842735135f,
//													0.34475531842735135f,
//													0.18098440003137717f,
//													0.039998528190083385f
//												};


#define CNT_FILTER_COEFS	5

/*****************************************************************************/
/****************************	Signal Scaling	******************************/
/*****************************************************************************/

// In signal: acceleration
#define		IN_ACCEL_RAW_MAX	1023
#define		IN_ACCEL_RAW_MIN	0
#define		IN_ACCEL_PHYS_MAX	100
#define		IN_ACCEL_PHYS_MIN	0

// In signal: break
#define		IN_BRAKE_RAW_MAX	1023
#define		IN_BRAKE_RAW_MIN	0
#define		IN_BRAKE_PHYS_MAX	100
#define		IN_BRAKE_PHYS_MIN	0


// Out signal: vehicle speed
#define		OUT_VEH_SPEED_RAW_MAX	199
#define		OUT_VEH_SPEED_RAW_MIN	0
#define		OUT_VEH_SPEED_PHYS_MAX	240
#define		OUT_VEH_SPEED_PHYS_MIN	0

// Out signal: engine speed
#define		OUT_ENGINE_SPEED_RAW_MAX	180
#define		OUT_ENGINE_SPEED_RAW_MIN	0
#define		OUT_ENGINE_SPEED_PHYS_MAX	7000
#define		OUT_ENGINE_SPEED_PHYS_MIN	0

// Out signal: fuel tank level
#define		OUT_FUEL_LVL_RAW_MAX	199
#define		OUT_FUEL_LVL_RAW_MIN	0
#define		OUT_FUEL_LVL_PHYS_MAX	100
#define		OUT_FUEL_LVL_PHYS_MIN	0


#endif //	DEFINES_H